home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / Freeware / Htmldoc / share / htmldoc / data / prolog.ps < prev    next >
Encoding:
Text File  |  2002-10-28  |  7.3 KB  |  325 lines

  1. %%BeginResource: procset htmldoc-device 1.8 22
  2.  
  3. %
  4. % The following procedures use setpagedevice, which is not supported by
  5. % Level 1 PostScript interpreters.  For these systems, make setpagedevice
  6. % a no-op.
  7. %
  8.  
  9. languagelevel 1 eq { /setpagedevice {pop} BD } if
  10.  
  11. %
  12. % trayMap
  13. %
  14. % The trayMap variable defines an array of tray positions that are
  15. % used when looking up the "MEDIA POSITION nnn" page comment.  The
  16. % array should be exactly 8 elements long.  Unavailable trays should
  17. % be set to -1.
  18. %
  19.  
  20. /trayMap [-1 -1 -1 -1 -1 -1 -1 -1] def
  21.  
  22. product (Xerox DocuPrint N4025 PS3) eq
  23.   { /trayMap [0 1 2 3 4 -1 -1 -1] def } if
  24.  
  25. product (Xerox DocuPrint N2025 PS) eq
  26.   { /trayMap [0 1 2 3 -1 -1 -1 -1] def } if
  27.  
  28. product (HP LaserJet 5Si/5Si MX PS) eq
  29.   { /trayMap [3 0 1 4 -1 -1 -1 -1] def } if
  30.  
  31. product (HP LaserJet 2100 Series) eq
  32.   { /trayMap [3 0 1 -1 -1 -1 -1 -1] def } if
  33.  
  34. product (Xerox Document Centre 220/230) eq
  35.   { /trayMap [1 2 3 4 -1 5 -1 -1] def } if
  36.  
  37. product (Xerox Document Centre 332/340) eq
  38.   { /trayMap [1 2 3 4 -1 5 -1 -1] def } if
  39.  
  40. %product (Insert ModelName string here) eq
  41. %  { /trayMap [-1 -1 -1 -1 -1 -1 -1 -1] def } if
  42.  
  43. %
  44. % haveMediaColor
  45. %
  46. % The haveMediaColor variable defines whether a printer supports the
  47. % MediaColor attribute in the page device dictionary.
  48. %
  49.  
  50. /haveMediaColor
  51.   product (Xerox Document Centre 220/230) eq
  52.   product (Xerox Document Centre 332/340) eq or
  53. %  product (Insert ModelName string here) eq or
  54. def
  55.  
  56. %
  57. % haveMediaPosition
  58. %
  59. % The haveMediaPosition variable defines whether a printer supports
  60. % the MediaPosition attribute in the page device dictionary.
  61. %
  62.  
  63. /haveMediaPosition
  64.   product (Xerox DocuPrint N2025 PS) eq
  65.   product (Xerox DocuPrint N4025 PS3) eq or
  66.   product (Xerox Document Centre 220/230) eq or
  67.   product (Xerox Document Centre 332/340) eq or
  68.   product (HP LaserJet 5Si/5Si MX PS) eq or
  69.   product (HP LaserJet 2100 Series) eq or
  70. %  product (Insert ModelName string here) eq or
  71. def
  72.  
  73. %
  74. % haveMediaType
  75. %
  76. % The haveMediaType variable defines whether a printer supports
  77. % the MediaType attribute in the page device dictionary.
  78. %
  79.  
  80. /haveMediaType
  81.   product (Xerox DocuPrint N2025 PS) eq
  82.   product (Xerox DocuPrint N4025 PS3) eq or
  83.   product (Xerox Document Centre 220/230) eq or
  84.   product (Xerox Document Centre 332/340) eq or
  85.   product (HP LaserJet 5Si/5Si MX PS) eq or
  86. %  product (Insert ModelName string here) eq or
  87. def
  88.  
  89. %
  90. % haveDeferredMediaSelection
  91. %
  92. % The haveDeferredMediaSelection variable defines whether a printer supports
  93. % the DeferredMediaSelection attribute in the page device dictionary.
  94. %
  95.  
  96. /haveDeferredMediaSelection
  97.   product (Xerox DocuPrint N2025 PS) eq
  98.   product (Xerox DocuPrint N4025 PS3) eq or
  99.   product (HP LaserJet 5Si/5Si MX PS) eq or
  100. %  product (Insert ModelName string here) eq or
  101.   not
  102. def
  103.  
  104. %
  105. % haveManualFeed
  106. %
  107. % The haveManualFeed variable defines whether a printer supports
  108. % the ManualFeed attribute in the page device dictionary.
  109. %
  110.  
  111. /haveManualFeed
  112.   product (Xerox DocuPrint N2025 PS) eq
  113.   product (Xerox DocuPrint N4025 PS3) eq or
  114.   product (HP LaserJet 5Si/5Si MX PS) eq or
  115.   product (HP LaserJet 2100 Series) eq or
  116.   product (Xerox Document Centre 220/230) eq or
  117.   product (Xerox Document Centre 332/340) eq or
  118. %  product (Insert ModelName string here) eq or
  119.   not
  120. def
  121.  
  122. %
  123. % haveTraySwitch
  124. %
  125. % The haveTraySwitch variable defines whether a printer supports
  126. % the TraySwitch attribute in the page device dictionary.
  127. %
  128.  
  129. /haveTraySwitch
  130.   product (Xerox DocuPrint N2025 PS) eq
  131.   product (Xerox DocuPrint N4025 PS3) eq or
  132.   product (Xerox Document Centre 220/230) eq or
  133.   product (Xerox Document Centre 332/340) eq or
  134. %  product (Insert ModelName string here) eq or
  135.   not
  136. def
  137.  
  138. %
  139. % copies SetCopies -
  140. %
  141. % Set the number of copies to print.
  142. %
  143.  
  144. /SetCopies {
  145.   % Set the number of copies of each page. For Level 1 printers, use the
  146.   % #copies variable; otherwise, use the NumCopies attribute in the
  147.   % page device dictionary...
  148.   languagelevel 1 eq
  149.   { /#copies 1 index def }
  150.   { 2 dict begin /NumCopies 1 index currentdict end setpagedevice }
  151.   ifelse
  152.  
  153.   % Discard the argument on the stack...
  154.   pop
  155. } BD
  156.  
  157. %
  158. % duplex tumble SetDuplexMode -
  159. %
  160. % Set the duplexing mode; "duplex" and "tumble" are boolean values.
  161. %
  162.  
  163. /CurrentDuplex false def
  164. /CurrentTumble false def
  165.  
  166. /SetDuplexMode {
  167.   % See if the duplex settings have changed; if not, don't change
  168.   % them, otherwise some printers will reset their state and you
  169.   % end up with single-sided output...
  170.   1 index CurrentDuplex ne
  171.   1 index CurrentTumble ne or
  172.  
  173.   {
  174.     % Build a page device dictionary with the Duplex and Tumble
  175.     % attributes...
  176.     4 dict begin
  177.       /Duplex 2 index def
  178.       /Tumble 1 index def
  179.     currentdict end
  180.  
  181.     % Register the new attributes...
  182.     setpagedevice
  183.   } if
  184.  
  185.   % Save the arguments on the stack...
  186.   /CurrentTumble exch def
  187.   /CurrentDuplex exch def
  188. } BD
  189.  
  190. %
  191. % string SetMediaColor -
  192. %
  193. % Set the media color for the output.
  194. %
  195.  
  196. /CurrentMediaColor () def
  197.  
  198. /SetMediaColor {
  199.   dup CurrentMediaColor ne
  200.   {
  201.     haveMediaType {
  202.       haveMediaColor {
  203.     % Build a page device dictionary with the MediaColor attribute set to
  204.     % the argument...
  205.     2 dict begin
  206.       /MediaColor 1 index def
  207.     currentdict end
  208.       } {
  209.     % Build a page device dictionary with the MediaType attribute set to
  210.     % "Color"...
  211.     2 dict begin
  212.       /MediaType (Color) def
  213.     currentdict end
  214.       } ifelse
  215.  
  216.       % Register any new attributes...
  217.       setpagedevice
  218.     } if
  219.   } if
  220.  
  221.   % Save the media color on the stack...
  222.   /CurrentMediaColor exch def
  223. } BD
  224.  
  225. %
  226. % number SetMediaPosition -
  227. %
  228. % Set the media position (tray) for the output.
  229. %
  230.  
  231. /CurrentMediaPosition -1 def
  232.  
  233. /SetMediaPosition {
  234.   dup CurrentMediaPosition ne
  235.   {
  236.     haveMediaPosition {
  237.       % Add any tray position offset to the tray number.
  238.       trayMap exch 1 sub get dup 0 ge
  239.       {
  240.     % Build a page device dictionary with the MediaPosition,
  241.     % DeferredMediaSelection, ManualFeed, and TraySwitch attributes...
  242.     8 dict begin
  243.       /MediaPosition 1 index def
  244.       haveDeferredMediaSelection { /DeferredMediaSelection true def } if
  245.       haveTraySwitch { /TraySwitch false def } if
  246.       haveManualFeed { /ManualFeed false def } if
  247.     currentdict end
  248.  
  249.     % Register the new attributes...
  250.     setpagedevice
  251.       }
  252.       { pop }
  253.       ifelse
  254.     } if
  255.   } if
  256.  
  257.   % Save the media position on the stack...
  258.   /CurrentMediaPosition exch def
  259. } BD
  260.  
  261. %
  262. % string SetMediaType -
  263. %
  264. % Set the media type for the output.  Use a null string to do auto selection.
  265. %
  266.  
  267. /CurrentMediaType () def
  268.  
  269. /SetMediaType {
  270.   dup CurrentMediaType ne
  271.   {
  272.     haveMediaType
  273.     {
  274.       % Build a page device dictionary with the MediaType attribute...
  275.       2 dict begin
  276.     /MediaType 1 index def
  277.       currentdict end
  278.  
  279.       % Register the new attribute...
  280.       setpagedevice
  281.     } if
  282.   } if
  283.  
  284.   % Save the media type on the stack...
  285.   /CurrentMediaType exch def
  286. } BD
  287.  
  288. %
  289. % width height SetPageSize -
  290. %
  291. % Set the media size for the output.
  292. %
  293.  
  294. /CurrentPageWidth 0 def
  295. /CurrentPageLength 0 def
  296.  
  297. /SetPageSize {
  298.   1 index CurrentPageWidth ne
  299.   1 index CurrentPageLength ne or
  300.  
  301.   {
  302.     % Put the arguments in an array...
  303.     2 copy 2 array astore
  304.  
  305.     % Build a page device dictionary with the PageSize and ImageableArea
  306.     % attributes...
  307.     4 dict begin
  308.       /PageSize 1 index def
  309.       /ImageableArea null def
  310.     currentdict end
  311.  
  312.     % Register the new attributes...
  313.     setpagedevice
  314.  
  315.     % Don't need the page size array anymore...
  316.     pop
  317.   } if
  318.  
  319.   % Save the size on the stack...
  320.   /CurrentPageLength exch def
  321.   /CurrentPageWidth exch def
  322. } BD
  323.  
  324. %%EndResource
  325.